// 延迟执行
function currying(func){
    const args = []
    return function result(...rest){
        if(rest.length===0){
          return  func(...args)
        }
        args.push(...rest)
        return result
    }
}

const add = (...args) =>args.reduce((a,b) =>a+b)
const sum = curring(add)